package com.example.newdemo.view.draw;

import android.app.Activity;
import android.os.Bundle;
import android.widget.LinearLayout;

import androidx.annotation.Nullable;

import com.example.newdemo.R;
import com.example.newdemo.screenfit.UIAdapter;

public class DrawViewActivity extends Activity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_draw_view);
        init();
    }

    private void init() {
        LinearLayout layout=(LinearLayout) findViewById(R.id.ll_draw_view_root);
        final DrawView view=new DrawView(this);

        UIAdapter adapter=UIAdapter.getInstance();

        view.setMinimumHeight((int) adapter.scaleY());
        view.setMinimumWidth((int) adapter.scaleX());


        //通知view组件重绘
        view.invalidate();
        layout.addView(view);

    }

}
